$(function () {
    var questionId = GetQueryString("questionId");
    $("#addData").on("click", function () {
        var title = $("#title").val();
        var score = $("#score").val();
        var code = $("#code").val();
        var demand = $("#demand").val();
        var remark = $("#remark").val();
        if (title == "") {
            alert("问题标题不能为空！");
            return false;
        }
        var addSel = $.Params.create();
        addSel.addParams("title", title);
        addSel.addParams("questionId", questionId);
        addSel.addParams("score", score);
        addSel.addParams("code", code);
        addSel.addParams("demand", demand);
        addSel.addParams("remark", remark);
        addSel.ajax("post", getAdminIP() + "pfChecks", function (data) {
            if (data.success) {
                window.location.href = "pfCheckList.html?questionId=" + questionId;
            } else {
                alert(data.msg);
            }
        })
    })

    $("#cancelAdd").on("click", function () {
        history.go(-1);
    })
})